The disclosures herein relate generally to computer systems and more particularly to a method of detecting BIOS corruption in a computer system.
Computer systems require functional basic input/output system code, or xe2x80x9cBIOS,xe2x80x9d in order to boot. The BIOS code is stored in a flash memory, such as a flash EPROM or xe2x80x9cEEPROMxe2x80x9d, and is typically updated via an executable program that xe2x80x9cflashesxe2x80x9d the EEPROM, thus erasing the old BIOS image, and then reprograms the EEPROM with a new BIOS image. If this programming process is interrupted, for example, by a power failure, the BIOS will be only partially programmed, or corrupted, and therefore nonfunctional.
To enable recovery from the above-described situation, a special area of the BIOS flash RAM storage referred to as the xe2x80x9cboot blockxe2x80x9d contains sufficient information to initiate the BIOS recovery process (xe2x80x9crecovery codexe2x80x9d). Because the boot block is xe2x80x9clockablexe2x80x9d, the recovery code stored therein is generally not vulnerable to programming process interruptions and remains intact.
Currently, BIOS image corruption detection is accomplished by performing a cyclic redundancy check (xe2x80x9cCRCxe2x80x9d) on the BIOS image (or a predefined portion thereof) to calculate a CRC code therefor and then comparing the calculated CRC code to a CRC code for the image (or predefined portion) stored in the boot block. To complete the CRC check in a user-acceptable time, many of the early POST procedures, such as chipset initialization and memory configuration, are performed first; i.e., prior to computing the CRC code, using code stored in the boot block (xe2x80x9cboot block POST codexe2x80x9d). After the CRC code has been calculated and compared, if the BIOS image is intact (i.e., not corrupt), many of the same procedures must be performed again using code from a non-protected flash memory area (xe2x80x9cBIOS POST codexe2x80x9d) to ensure that up-to-date BIOS code is being used. This is because it is possible that the boot block POST code and the BIOS POST code may be different, in which case the BIOS POST code will be more up-to-date. The difficulty in keeping code stored in the boot block area sufficiently up-to-date to enable the CRC code to be calculated results in the code being reprogrammed on every flash update, thus voiding the protection mechanism.
Therefore, what is needed is a method of detecting corruption of the BIOS code that does not require CRC checking or reprogramming of the boot block upon each reprogramming of the BIOS code.
One embodiment accordingly, provides for detecting a corrupt basic input/output system (BIOS) stored in a flash memory device of a computer. Responsive to the computer being booted, it is determined whether a first byte of the BIOS is programmed. Responsive to that determination, it is determined whether a last byte of the BIOS is programmed. Further, responsive to the last byte determination, it is concluded that the BIOS is not corrupt and normal POST procedures are carried out.
A principal advantage of this embodiment is that it does not require the boot block to be erased and reprogrammed each time the BIOS code is reprogrammed, thereby maintaining the integrity of this portion of the BIOS code as originally intended.
Another advantage of this embodiment is that it is faster and more efficient than the methods of BIOS corruption detection that employ CRC codes.